package speed2010.util;

import speed2010.middleware.comunicacao.Address;

public class TrioAddress extends ParAddress{
	private Address addressNode3 = null;

	public TrioAddress(Address addressNode1, Address addressNode2, Address addressNode3) {
		super(addressNode1, addressNode2);
		this.addressNode3 = addressNode3;
	}

	@Override
	public boolean equals(Object obj) {
		if (this.getAddressNode1().equals(((TrioAddress) obj).getAddressNode1())
				&& this.getAddressNode2().equals(((TrioAddress) obj).getAddressNode2())
				&& this.getAddressNode3().equals(((TrioAddress) obj).getAddressNode3())) {
			return true;
		} else {
			return false;
		}
	}

	public Address getAddressNode3() {
		return addressNode3;
	}

	public void setAddressNode3(Address addressNode3) {
		this.addressNode3 = addressNode3;
	}

	@Override
	public String toString() {
		return super.toString() + " ; "
				+ this.getAddressNode3().toStringReduzido();
	}
}
